import { FC } from 'react'
import { Table, PaginationProps, Pagination } from 'antd'
import React from 'react'

interface DataType {
  key: React.Key
  membernumber:number,
  name: string
  time: string
  shop: string
  point: string
  business: string
  price: string
  balance: number
  tel: number
  checker: string
}

const showTotal: PaginationProps['showTotal'] = total => `共有 ${total} 条记录`

const columns = [
  {
    title: '序号',
    dataIndex: 'key',
    key: 'key',
  },
  {
    title: '会员号',
    dataIndex: 'membernumber',
    key: 'key',
  
  },
  {
    title: '姓名',
    dataIndex: 'name',
    key: 'key',
  },
  {
    title: '时间',
    dataIndex: 'time',
    key: 'key',
  },
  {
    title: '门店',
    dataIndex: 'shop',
    key: 'key',
  },
  {
    title: '积分类型',
    dataIndex: 'point',
    key: 'key',
  },
  {
    title: '交易方式',
    dataIndex: 'business',
    key: 'key',
  },
  {
    title: '金额',
    dataIndex: 'price',
    key: 'key',
  },
  {
    title: '变动积分',
    dataIndex: 'balance',
    key: 'key',
  },
  {
    title: '剩余积分',
    dataIndex: 'tel',
    key: 'key',
  },
  {
    title: '收银员',
    dataIndex: 'checker',
    key: 'key',
  },
]

const data: DataType[] = [
  {
    key: '1',
    membernumber: 620001,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（天河店）',
    point: '收入',
    business: '支付宝',
    price: '￥32.00',
    balance: 1000,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '2',
    membernumber: 620002,
    name: '会员1',
    time:  '2019-06-10 12:00:12',
    shop: '山里人家（越秀店）',
    point: '收入',
    business: '支付宝',
    price: '￥15.00',
    balance: 1000,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '3',
    membernumber: 620003,
    name: '会员1',
    time:  '2019-06-10 12:00:12',
    shop: '山里人家（海珠店）',
    point: '支出',
    business: '积分',
    price: '￥33.80',
    balance: 500,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '4',
    membernumber: 620004,
    name: '会员1',
    time:  '2019-06-10 12:00:12',
    shop: '山里人家（黄埔店）',
    point: '支出',
    business: '积分',
    price: '￥33.80',
    balance: 1000,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '5',
    membernumber: 620005,
    name: '会员1',
    time:  '2019-06-10 12:00:12',
    shop: '山里人家（天河店）',
    point: '收入',
    business: '积分',
    price: '￥33.80',
    balance: 500,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '6',
    membernumber: 620005,
    name: '会员1',
    time:  '2019-06-10 12:00:12',
    shop: '山里人家（越秀店）',
    point: '收入',
    business: '积分',
    price: '￥33.80',
    balance: 1000,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '7',
    membernumber: 620006,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（天河店）',
    point: '支出',
    business: '支付宝',
    price: '￥33.80',
    balance: 200,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '8',
    membernumber: 620007,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（越秀店）',
    point: '支出',
    business: '支付宝',
    price: '￥33.80',
    balance: 0,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '9',
    membernumber: 620008,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（天河店）',
    point: '支出',
    business: '积分',
    price: '￥33.80',
    balance: 0,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '10',
    membernumber: 620009,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（越秀店）',
    point: '支出',
    business: '积分',
    price: '￥33.80',
    balance: 0,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '11',
    membernumber: 620010,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（天河店）',
    point: '收入',
    business: '积分',
    price: '￥33.80',
    balance: 0,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '12',
    membernumber: 620011,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（越秀店）',
    point: '收入',
    business: '积分',
    price: '￥33.80',
    balance: 800,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '13',
    membernumber: 620012,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（天河店）',
    point: '收入',
    business: '支付宝',
    price: '￥33.80',
    balance: 1000,
    tel: 100,
    checker: '十月大神'
  },
  {
    key: '14',
    membernumber: 620013,
    name: '会员1',
    time: '2019-06-10 12:00:12',
    shop: '山里人家（越秀店）',
    point: '收入',
    business: '积分',
    price: '￥33.80',
    balance: 1000,
    tel: 100,
    checker: '十月大神'
  },
]
const AppPointData: FC = () => {
  return (
    <div className='styled-profile-data'>
      <Table columns={columns} dataSource={data} pagination={false} tableLayout={'auto'} />
      <Pagination 
      size="small"
      total={13}
      showTotal={showTotal}
      showSizeChanger
      showQuickJumper
      />
    </div>
  )
}

 
export default AppPointData

